<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 1.无参数的函数定义
        function addition() {
            var result = 1 + 3;
            console.log("addition=" + result);
        }
        addition();
        // 2.有参数的函数定义
        // 在函数定义时，num1 num2称为形参
        function subtraction(num1, num2) {
            var result = num1 - num2;
            console.log("subtraction=" + result);
        }
        // 在函数调用的时候，8 2称为实参
        subtraction();

        // 3.函数返回值
        function multiplication(num1, num2) {
            var result = num1 * num2;
            // return 返回
            return result;
        }
        var res = multiplication(3, 8);
        console.log("multiplication=" + res);
    </script>
</body>

</html>